home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_200
/
266_01
/
plox.doc
< prev
next >
Wrap
Text File
|
1990-07-20
|
16KB
|
313 lines
micro PLOX PLOX.DOC
Version 5.0
Bob Patton
1713 Parkcrest Terrace
Arlington, TX 76012
July 1990
Micro PLOX is a plotting language that gives the user direct control
of the plotting features of a dot matrix printer or a graphics
monitor. It was designed with graphs in mind, but it can be used
to make forms and straight line drawings.
It will draw lines in various patterns and print text in 2 compact
fonts. The maximum area of a single drawing is 7 inches wide by
5 inches high which is roughly half of a standard typewriter page
with margins allowed. From data it will draw line or bar graphs.
The lines may be of various patterns and colors and the points may
be shown with a symbol or not. The bars may have various hatching
patterns. The text may be located at a specific location with a
TITLE or may be located relative to data with a LABEL.
Statements in PLOX consist of a keyword (in capitals recommended for
readability) followed by options in lower case and digits. (Text strings
should be upper and lower case as wanted. File names may be upper or
lower case.) For example:
* Sample stock plot
PIC size 7 by 2.5 outline
TITLE at 3.5,2.4 text NORTHEAST INVESTOR'S TRUST
AREA at .5,.5 size 6 by 1.8
AXIS left to 30
AXIS below from 85 to 88 boxes=3
LINE file B:NOEAST.DAT item 1 is yymmdd
PLOX is interpretive; items specified are drawn as they are
encountered so the statements must be pretty much in the order
shown. PIC must come first as it starts the process and sets
the reference point for further dimensions given.
TITLE may come anyplace but its location will be affected by what
has come before it. In the example above the title is centered at
coordinates 3.5,2.4 inches with respect to the whole picture which
has a size of 7 inches wide by 2.5 inches high.
An AREA is a rectangular field in which to put plots. It has a
location (of the lower, left corner) and a size. Any titles given
after an AREA are located with respect to the location of the AREA.
Both an x and a y AXIS must be specified to scale the data. An AXIS
is presumed to start at 0 unless shown otherwise by a "from" option.
You may specify the number of scale divsions as "boxes" or let PLOX
do it for you.
A LINE may now be drawn from a data file with a pairs of x and y data
points. You must give the name of the data file. You may have date
data in the form yymmdd and so specify to PLOX. These will be converted
to YY.fract for plotting. For example 870630 might be converted to
87.496.
BARS may also be drawn from x and y data pairs. The bars may be
horizontal or vertical and will normally extend from the data point to
the axis, but you may specify a different base (in data-units, not inches).
You may specify the width of a bar (in inches).
You can in general have more than one of each statement (except PIC).
Just remember that order counts. You can have many LINEs in an AREA.
You can have many AREAs in a PIC, and you can put TITLEs anywhere.
You can even put more than 2 axes on a area, but the data plotted will
be scaled to the last x and last y AXIS given.
The options on a given statement may come in any order and may be spaced
to suit yourself. The only current exception is the text of a title
which must be last and may be on a separate TITLE statement if it is
long. The title is drawn as soon as the text is encountered. There are
optional punctuation and filler words for readability. You may use
commas and equal signs anywhere. The words "by", "is", and "are" are
ignored. Comments may be included with PLOX statements by starting
the comment line with an asterisk.
Getting a plot printed
This is a two step process. Write the PLOX statements and provide a
data file with the numbers to be plotted. A naming convention is
recommended. We suggest .PIC for the PLOX statements and .DAT for
data files. Execute the PLOX command giving the name of your file
of PLOX statements:
PLOX MYPLOX.PIC
This will create a binary file of plot commands named PLOTCOM.DAT.
Then run program PLOTEPS or PLOTEPS2 which will output directly to
your printer. As the name suggests this device driver is for Epson
printers, but device drivers for graphics monitors are also provided.
PLOTEPS or PLOTEPS2
That's all there is to it. PLOTEPS expects its input in PLOTCOM.DAT
which is a little limiting, but simple to run and less error prone.
There is really not much need to save the binary file of plot commands
since it can always be recreated from the PLOX statements, but you
could rename it if you did want to keep it.
If your printer ribbon is worn or you are making a chart for photo
copying you can add the letter d after the command to get dark print
which is done by just printing each line twice. For example:
PLOTEPS d
You can also view the chart on a graphics monitor if you have one.
Simply use PLOTHERC, PLOTCGA, PLOTEGA, or PLOTVGA as the second
command. You can use this to debug charts or as the only way you
look at charts. If you are debugging for final print, note that the
binary file still exists so all you have to do is issue a PLOTEPS
to get the printed version once you like what you see on the screen.
We recommend PLOTEGA even on a VGA monitor as the lettering size is
more pleasing.
While PLOX is running it will echo your statements and print any errors
found underneath them. You can then correct and rerun before you plot.
Data for plotting
The data to be plotted must be columns of numbers separated by one or
more blanks. You may have up to 14 columns in any one file. Dates may
be given in the form yymmdd and they will be translated to YY.frac for
plotting if the plotting statement (e.g., LINE) specifies it. Years
less than 50 will have 100 added to allow for dates in the first half
of the 21st century. Missing numbers may be shown by a single asterisk
(*) and they will be skipped.
The columns are referenced by number (1, 2, etc.) from left to right
and are known as items to PLOX. If not specified, PLOX assumes that
item 1 is the x-value and item 2 the y-value to be plotted. Plotting
statements may specify which items to plot as:
items ix iy
where ix is the x-value column number and iy the y-value column number.
Thus with 3 sets of numbers to plot versus the same set of dates you
could put the dates in column 1 and the numbers in columns 2, 3, and 4
and plot them as follows.
LINE file DATA.DAT items 1 2 item 1 is yymmdd
LINE file DATA.DAT items 1 3 item 1 is yymmdd
LINE file DATA.DAT items 1 4 item 1 is yymmdd
You may include comment lines in data by starting the line with a slash.
Why not an asterisk for consistency? Because asterisk is reserved to
show missing values and this in turn is to be consistent with some
other languages (including main frame PLOX) as was the use of
asterisk for comments in statements to begin with. Sorry about that.
You may further elect to have the data for any single plot
immediately follow the plot statement (LINE or BARS) by specifying
file *. Such data must be ended by a dollar sign ($) in column one.
In this case it would be pointless to have more than 2 columns of
data as that's all you can plot with a single statement. See the
legend data of BIKE.PIC for an example of this.
Another option is to give the data file name as @. Then you may put
the actual file to use on the PLOX command line, or if you don't put
it there you will be prompted for it. This may be combined with PLOX
statements allowed in the data file to let you make any number of
similar charts from a single picture description using a different data
file for each chart. See the FUNDINFO.PIC file and associated data files
FUND01.DAT and FUND02.DAT for examples of this.
Other PLOX feat